package org.shoukaiseki.dubbo.consumer;

import org.springframework.boot.SpringApplication;

import javax.annotation.PostConstruct;
import com.alibaba.dubbo.config.annotation.Reference;
import org.shoukaiseki.dubbo.provider.HelloService;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@SpringBootApplication
@Controller
public class ConsumerApplication {

	@RequestMapping("/")
	@ResponseBody
	public String index(){
		return demoService.sayHello("world");
	}

	@Reference(version = "1.0.0",registry = "my-registry")
  	private HelloService demoService;

	public static void main(String[] args) {
		
		SpringApplication.run(ConsumerApplication.class, args);
	}
	
}
